package norm.reference

import grails.test.*

class TupleTests extends GrailsUnitTestCase {

	def tuple
    protected void setUp() {
        super.setUp()
		tuple = new Tuple(value: new BigDecimal(3.0), probability: new BigDecimal(0.98))
		
    }

    protected void tearDown() {
        super.tearDown()
    }

    void testCompareTo() {
		def smallerTuple = new Tuple(value: new BigDecimal(2.5), probability: new BigDecimal(0.12))
		def biggerTuple = new Tuple(value: new BigDecimal(4.5), probability: new BigDecimal(0.12))
		def equalTuple = new Tuple(value: new BigDecimal(3.0), probability: new BigDecimal(0.12))

		assertEquals(1, tuple.compareTo(smallerTuple))
		assertEquals(-1, tuple.compareTo(biggerTuple))
		assertEquals(0, tuple.compareTo(equalTuple))
		}
}
